/**
 * <copyright>
 * </copyright>
 *

 */
package org.openarchitectureware.recipe2.dsl.recipeBuilder.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import org.openarchitectureware.recipe2.dsl.recipeBuilder.Import;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.PluginImport;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.PluginTemplate;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.PredefTemplate;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.PredefTemplatePackage;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.RecipeBuilderFactory;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.RecipeBuilderModel;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.RecipeBuilderPackage;
import org.openarchitectureware.recipe2.dsl.recipeBuilder.Template;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class RecipeBuilderPackageImpl extends EPackageImpl implements RecipeBuilderPackage
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass recipeBuilderModelEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass importEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass pluginImportEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass predefTemplatePackageEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass templateEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass predefTemplateEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass pluginTemplateEClass = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see org.openarchitectureware.recipe2.dsl.recipeBuilder.RecipeBuilderPackage#eNS_URI
   * @see #init()
   * @generated
   */
  private RecipeBuilderPackageImpl()
  {
    super(eNS_URI, RecipeBuilderFactory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
   * 
   * <p>This method is used to initialize {@link RecipeBuilderPackage#eINSTANCE} when that field is accessed.
   * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static RecipeBuilderPackage init()
  {
    if (isInited) return (RecipeBuilderPackage)EPackage.Registry.INSTANCE.getEPackage(RecipeBuilderPackage.eNS_URI);

    // Obtain or create and register package
    RecipeBuilderPackageImpl theRecipeBuilderPackage = (RecipeBuilderPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RecipeBuilderPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RecipeBuilderPackageImpl());

    isInited = true;

    // Create package meta-data objects
    theRecipeBuilderPackage.createPackageContents();

    // Initialize created meta-data
    theRecipeBuilderPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theRecipeBuilderPackage.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(RecipeBuilderPackage.eNS_URI, theRecipeBuilderPackage);
    return theRecipeBuilderPackage;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getRecipeBuilderModel()
  {
    return recipeBuilderModelEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getRecipeBuilderModel_Imports()
  {
    return (EReference)recipeBuilderModelEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getRecipeBuilderModel_PluginImports()
  {
    return (EReference)recipeBuilderModelEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getRecipeBuilderModel_PluginTemplates()
  {
    return (EReference)recipeBuilderModelEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getRecipeBuilderModel_PredefTemplatePatterns()
  {
    return (EReference)recipeBuilderModelEClass.getEStructuralFeatures().get(3);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getRecipeBuilderModel_PredefTemplates()
  {
    return (EReference)recipeBuilderModelEClass.getEStructuralFeatures().get(4);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getImport()
  {
    return importEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getImport_ImportURI()
  {
    return (EAttribute)importEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getPluginImport()
  {
    return pluginImportEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPluginImport_Name()
  {
    return (EAttribute)pluginImportEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPluginImport_Version()
  {
    return (EAttribute)pluginImportEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPluginImport_ReExport()
  {
    return (EAttribute)pluginImportEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getPredefTemplatePackage()
  {
    return predefTemplatePackageEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPredefTemplatePackage_Name()
  {
    return (EAttribute)predefTemplatePackageEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPredefTemplatePackage_TemplatePackage()
  {
    return (EAttribute)predefTemplatePackageEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getTemplate()
  {
    return templateEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getTemplate_Template()
  {
    return (EAttribute)templateEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getPredefTemplate()
  {
    return predefTemplateEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getPredefTemplate_Name()
  {
    return (EAttribute)predefTemplateEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getPluginTemplate()
  {
    return pluginTemplateEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RecipeBuilderFactory getRecipeBuilderFactory()
  {
    return (RecipeBuilderFactory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    recipeBuilderModelEClass = createEClass(RECIPE_BUILDER_MODEL);
    createEReference(recipeBuilderModelEClass, RECIPE_BUILDER_MODEL__IMPORTS);
    createEReference(recipeBuilderModelEClass, RECIPE_BUILDER_MODEL__PLUGIN_IMPORTS);
    createEReference(recipeBuilderModelEClass, RECIPE_BUILDER_MODEL__PLUGIN_TEMPLATES);
    createEReference(recipeBuilderModelEClass, RECIPE_BUILDER_MODEL__PREDEF_TEMPLATE_PATTERNS);
    createEReference(recipeBuilderModelEClass, RECIPE_BUILDER_MODEL__PREDEF_TEMPLATES);

    importEClass = createEClass(IMPORT);
    createEAttribute(importEClass, IMPORT__IMPORT_URI);

    pluginImportEClass = createEClass(PLUGIN_IMPORT);
    createEAttribute(pluginImportEClass, PLUGIN_IMPORT__NAME);
    createEAttribute(pluginImportEClass, PLUGIN_IMPORT__VERSION);
    createEAttribute(pluginImportEClass, PLUGIN_IMPORT__RE_EXPORT);

    predefTemplatePackageEClass = createEClass(PREDEF_TEMPLATE_PACKAGE);
    createEAttribute(predefTemplatePackageEClass, PREDEF_TEMPLATE_PACKAGE__NAME);
    createEAttribute(predefTemplatePackageEClass, PREDEF_TEMPLATE_PACKAGE__TEMPLATE_PACKAGE);

    templateEClass = createEClass(TEMPLATE);
    createEAttribute(templateEClass, TEMPLATE__TEMPLATE);

    predefTemplateEClass = createEClass(PREDEF_TEMPLATE);
    createEAttribute(predefTemplateEClass, PREDEF_TEMPLATE__NAME);

    pluginTemplateEClass = createEClass(PLUGIN_TEMPLATE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    predefTemplateEClass.getESuperTypes().add(this.getTemplate());
    pluginTemplateEClass.getESuperTypes().add(this.getTemplate());

    // Initialize classes and features; add operations and parameters
    initEClass(recipeBuilderModelEClass, RecipeBuilderModel.class, "RecipeBuilderModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getRecipeBuilderModel_Imports(), this.getImport(), null, "imports", null, 0, -1, RecipeBuilderModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getRecipeBuilderModel_PluginImports(), this.getPluginImport(), null, "pluginImports", null, 0, -1, RecipeBuilderModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getRecipeBuilderModel_PluginTemplates(), this.getPluginTemplate(), null, "pluginTemplates", null, 0, -1, RecipeBuilderModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getRecipeBuilderModel_PredefTemplatePatterns(), this.getPredefTemplatePackage(), null, "predefTemplatePatterns", null, 0, -1, RecipeBuilderModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getRecipeBuilderModel_PredefTemplates(), this.getPredefTemplate(), null, "predefTemplates", null, 0, -1, RecipeBuilderModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(importEClass, Import.class, "Import", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getImport_ImportURI(), ecorePackage.getEString(), "importURI", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(pluginImportEClass, PluginImport.class, "PluginImport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getPluginImport_Name(), ecorePackage.getEString(), "name", null, 0, 1, PluginImport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPluginImport_Version(), ecorePackage.getEString(), "version", null, 0, 1, PluginImport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPluginImport_ReExport(), ecorePackage.getEBoolean(), "reExport", null, 0, 1, PluginImport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(predefTemplatePackageEClass, PredefTemplatePackage.class, "PredefTemplatePackage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getPredefTemplatePackage_Name(), ecorePackage.getEString(), "name", null, 0, 1, PredefTemplatePackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getPredefTemplatePackage_TemplatePackage(), ecorePackage.getEString(), "templatePackage", null, 0, 1, PredefTemplatePackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getTemplate_Template(), ecorePackage.getEString(), "template", null, 0, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(predefTemplateEClass, PredefTemplate.class, "PredefTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getPredefTemplate_Name(), ecorePackage.getEString(), "name", null, 0, 1, PredefTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(pluginTemplateEClass, PluginTemplate.class, "PluginTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    // Create resource
    createResource(eNS_URI);
  }

} //RecipeBuilderPackageImpl
